.wrapper{
    position: relative;
    top: 0;
    height: 100vh;
}

.sidebar{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    width: 260px;
    background: $white-color;
    @include shadow-big();

    &[data-background-color="black"]{
        background-color: #191919;
    }

    .logo-img{
        width: 42px;
        max-height: 42px;

        img{
            width: 42px;
            top: 16px;
            left: 18px;
            position: absolute;
        }
    }
    .sidebar-wrapper{
        position: relative;
        height: calc(100vh - 70px);
        overflow: auto;
        width: 260px;
        z-index: 4;

        padding-bottom: 30px;

        .dropdown .dropdown-backdrop{
            display: none !important;
        }

        .navbar-form{
            border: none;
            box-shadow: none;
        }

        .nav,
        .user .info{
            [data-toggle="collapse"] ~ div > ul > li > a{
                span{
                    display: inline-block;
                }

                .sidebar-normal{
                    margin: 0;
                    position: relative;
                    @include transform-translate-x(0px);
                    opacity: 1;
                    white-space: nowrap;
                    @include transition-opacity-transform($general-transition-time, $transition-linear);
                }

                .sidebar-mini{
                    text-transform: uppercase;
                    width: 30px;
                    margin-right: 15px;
                    float: left;
                    text-align: center;
                    letter-spacing: 1px;
                    position: relative;
                    display: inherit;
                }

                i{
                    font-size: 17px;
                    line-height: 20px;
                    width: 26px;
                }
            }
        }

        .user .info{
            [data-toggle="collapse"] ~ div > ul > li > a{
                .sidebar-normal{
                    @include transform-translate-x(0px);
                }
            }
        }

    }

    .logo-tim{
        border-radius: 50%;
        border: 1px solid #333;
        display: block;
        height: 61px;
        width: 61px;
        float: left;
        overflow: hidden;

        img{
            width: 60px;
            height: 60px;
        }
    }

    .nav{
        padding-top: 15px;

        .caret{
            margin-top: 13px;
            position: absolute;
            right: 18px;
        }

        li{
            > a{
                margin: 10px 15px 0;
                border-radius: $border-radius-base;
                color: $black-color;
                padding-left: 10px;
                padding-right: 10px;

                &:hover,
                &:focus{
                    background-color: transparent;
                    outline: none;
                }
            }

            &:first-child > a{
                margin: 0 15px;
            }

            &:hover > a,
            &.active > [data-toggle="collapse"]{
                background-color: rgba(200, 200, 200, 0.2);
                color: $black-color;
                box-shadow: none;
            }

            &.active > [data-toggle="collapse"]{
                i{
                    color: #a9afbb;
                }
            }

            &.active > a,
            &.active > a i{
                color: $white-color;
            }

            &.separator{
                margin: 15px 0;

                &:after{
                    width: calc(100% - 30px);
                    content: "";
                    position: absolute;
                    height: 1px;
                    left: 15px;
                    background-color: rgba(180,180,180, .3);
                }

                & + li {
                    margin-top: 31px;
                }
            }
        }

        p{
            margin: 0;
            line-height: 30px;
            font-size: 14px;
            white-space: nowrap;
            opacity: 1;
            display: block;
            height: auto;
            @include transform-translate-x(0);
            @include transition-opacity-transform($general-transition-time, $transition-linear);
        }

        i{
            font-size: 24px;
            float: left;
            margin-right: 15px;
            line-height: 30px;
            width: 30px;
            text-align: center;
            color: #a9afbb;
        }
    }

    .sidebar-background{
        position: absolute;
        z-index: 1;
        height: 100%;
        width: 100%;
        display: block;
        top: 0;
        left: 0;
        background-size: cover;
        background-position: center center;

        &:after{
            position: absolute;
            z-index: 3;
            width: 100%;
            height: 100%;
            content: "";
            display: block;
            background: #FFFFFF;
            opacity: .93;
        }
    }

    .logo{
        padding: 15px 0px;
        margin: 0;
        display: block;
        position: relative;
        z-index: 4;

        &:after{
            content: '';
            position: absolute;
            bottom: 0;
            right: 15px;
            height: 1px;
            width: calc(100% - 30px);
            background-color: rgba(180,180,180, .3);

        }

        p{
            float: left;
            font-size: 20px;
            margin: 10px 10px;
            color: $white-color;
            line-height: 20px;
        }

        .simple-text{
            text-transform: uppercase;
            padding: $padding-small-vertical $padding-zero;
            display: block;
            font-size: $font-size-large;
            color: $black-color;
            text-align: center;
            white-space: nowrap;
            font-weight: $font-weight-default;
            line-height: 30px;
            overflow: hidden;
            @extend .animation-transition-general;
        }

        .logo-normal{
            @extend .animation-transition-general;
        }
    }

    .logo-tim{
        border-radius: 50%;
        border: 1px solid #333;
        display: block;
        height: 61px;
        width: 61px;
        float: left;
        overflow: hidden;

        img{
            width: 60px;
            height: 60px;
        }
    }

    .user{
        padding-bottom: 20px;
        margin:20px auto 0;
        position: relative;

        &:after{
            content: '';
            position: absolute;
            bottom: 0;
            right: 15px;
            height: 1px;
            width: calc(100% - 30px);
            background-color: rgba(180,180,180, .3);
        }

        .photo{
            width: 34px;
            height: 34px;
            float: left;
            overflow: hidden;
            margin-right: 11px;
            border-radius: 50%;
            margin-left: 23px;
            z-index: 5;
            @include shadow-big();
            @extend .animation-transition-general;

            img{
                width: 100%;
            }
        }

        a{
            color: $black-color;
            padding: $padding-base-vertical $padding-large-vertical;
            display: block;
            white-space: nowrap;
            @extend .animation-transition-general;
        }

        .info{
            .caret{
                position: absolute;
                top: 16px;
                right: 26px;
            }

            > a{
                padding-left: 70px;
            }
        }
    }

    &[data-background-color="black"]{
        background-color: #191919;
        @include sidebar-background-color($gray-base, $white-color);
    }

    &[data-background-color="red"]{
        background-color: $red-600;
        @include sidebar-background-color($red-A700, $white-color);

        .user,
        .logo,
        .nav li.separator{
            &:after{
                background-color: rgba(255,255,255, .3);
            }
        }

        .nav{
            li:hover:not(.active) > a,
            li.active > [data-toggle="collapse"]{
                background-color: rgba(255, 255, 255, 0.1);
            }
        }
    }

    &[data-active-color="purple"]{
        @include set-background-color-button($brand-primary);
    }
    &[data-active-color="blue"]{
        @include set-background-color-button($brand-info);
    }
    &[data-active-color="green"]{
        @include set-background-color-button($brand-success);
    }
    &[data-active-color="orange"]{
        @include set-background-color-button($brand-warning);
    }
    &[data-active-color="red"]{
        @include set-background-color-button($brand-danger);
    }
    &[data-active-color="rose"]{
        @include set-background-color-button($brand-rose);
    }
    &[data-active-color="white"]{
        @include set-background-color-button($white-color);
        @include sidebar-active-color($black-color);

        .sidebar-moving-tab{
            color: $black-color;
            @include shadow-big-color($black-color);

            i{
                color: rgba($black-color, .8);
            }
        }
    }

    &[data-image]:after,
    &.has-image:after{
        opacity: .77;
    }
}
//
// .off-canvas-sidebar{
//     .nav {
//         > li > a,
//         > li > a:hover{
//             color: $white-color;
//         }
//
//         > li > a:focus{
//             background: rgba(200, 200, 200, 0.2);
//         }
//     }
// }


.main-panel{
    position: relative;
    float: right;
    width: $sidebar-width;
    min-height: 100%;
    @include transition (0.33s, cubic-bezier(0.685, 0.0473, 0.346, 1));

    .main-content{
        margin-top: 70px;
        padding: 30px 15px;
        min-height: calc(100vh - 123px);

        .container-fluid{
            h3:first-child{
                margin-top: 0;
            }
        }
    }

    > .footer{
        border-top: 1px solid #e7e7e7;
    }

    > .navbar{
        margin-bottom: 0;
    }

    .header{
        margin-bottom: 30px;

        .title{
            margin-top: 10px;
        }
    }
}

.main-panel{
    max-height: 100%;
    height: 100%;
}
.sidebar,
.main-panel,
.sidebar-wrapper{
    -webkit-transition-property: top,bottom,width;
    transition-property: top,bottom, width;
    -webkit-transition-duration: .2s,.2s, .35s;
    transition-duration: .2s,.2s, .35s;
    -webkit-transition-timing-function: linear,linear,ease;
    transition-timing-function: linear,linear,ease;
    -webkit-overflow-scrolling: touch;
}

.visible-on-sidebar-regular{
    display: inline-block !important;
}
.visible-on-sidebar-mini{
    display: none !important;
}

@media (min-width: $screen-md) {
    .sidebar-mini{
        .visible-on-sidebar-regular{
            display: none !important;
        }
        .visible-on-sidebar-mini{
            display: inline-block !important;
        }

        .sidebar-moving-tab{
            width: 50px;

            &.moving{
                .sidebar-normal,
                p{
                    display: none;
                }

                .sidebar-mini{
                    position: relative;
                }
            }
        }

        .sidebar{
            width: 80px;

            .sidebar-wrapper{
                width: 80px;

                .nav li > a p{
                    opacity: 0;
                    @include transform-translate-x(-25px);
                }

                .nav,
                .user .info{
                    [data-toggle="collapse"] ~ div > ul > li > a{
                        .sidebar-normal{
                            @include transform-translate-x(15px);
                            opacity: 0;
                        }
                    }
                }

                .user .info{
                    [data-toggle="collapse"] ~ div > ul > li > a{
                        .sidebar-normal{
                            @include transform-translate-x(25px);
                        }
                    }
                }
            }

            .user .info{
                > a{
                    line-height: 21px;
                    padding-left: 45px;
                    opacity: 0;
                }
            }

            .logo{
                .logo-normal{
                    a{
                        opacity: 0;
                        text-align:center;
                        position: relative;
                        padding-left: 40px;
                    }
                }
            }
        }

        .main-panel{
            width: calc(100% - 80px);
            margin-left: 80px;
        }

        .sidebar:hover{
            width: 260px !important;

            .sidebar-moving-tab{
                width: 230px;

                &.moving{
                    .sidebar-normal,
                    p{
                        display: block;
                    }

                    .sidebar-mini{
                        position: absolute;
                    }
                }
            }

            .sidebar-wrapper{
                width: 260px !important;

                .nav li > a p{
                    opacity: 1;
                    @include transform-translate-x(0px);
                }

                .nav [data-toggle="collapse"] ~ div > ul > li > a .sidebar-normal{
                    @include transform-translate-x(0px);
                    opacity: 1;
                }

                .user{
                    padding-bottom: 20px;
                    height: auto;

                    .info{
                        > a{
                            padding-left: 70px;
                            opacity: 1;
                        }

                        [data-toggle="collapse"] ~ div > ul > li > a .sidebar-normal{
                            opacity: 1;
                            transform: translateX(0px);
                        }
                    }
                }
            }

            .logo{
                .logo-normal{
                    a{
                        opacity: 1;
                        padding-left: 0;
                    }

                }

                .logo-mini{
                    position: absolute;
                    top: 18px;
                    opacity: 0;
                }
            }
        }
    }
}

.hide-sidebar{
    .sidebar{
        @extend .animation-transition-general;

        @include transform-translate-x(-260px);
    }

    .main-panel{
        width: 100%;
    }

    &.sidebar-mini{

        .sidebar{
            @extend .animation-transition-general;

            @include transform-translate-x(-80px);
        }
    }
}
.animation{
    @extend .animation-transition-general;
}
